////////////////////////////////////////////////////////////////////////////////
//File:					UglyObjModel.h
//Author:				Kesitem
//This file is part of UglyProject.
//See UglyProjet.txt for copyright informations.
////////////////////////////////////////////////////////////////////////////////
#ifndef __UGLYOBJMODEL_H__
#define __UGLYOBJMODEL_H__

#include "UglyCore.h"

namespace Ugly
{

/**
 * \brief Obj model class.
 */
class ObjModel
{
public:

    /**
     * \brief Constructor.
     */
    ObjModel();

    /**
     * \brief Destructor.
     */
    virtual ~ObjModel();

    /**
     * \brief Create model from file.
     *
     * \param   _Filename   File name.
     * \return False if error.
     */
    bool create(const std::string &_Filename);

    /**
     * \brief Destroy model.
     */
    void destroy();

    /**
     * \brief Get vertex buffer id.
     *
     * \return Vertex buffer id.
     */
    GLuint getVertexBufferId() const;

    /**
     * \brief Get texcoord buffer id.
     *
     * \return Texcoord buffer id.
     */
    GLuint getTexCoordBufferId() const;

    /**
     * \brief Get normal buffer id.
     *
     * \return Normal buffer id.
     */
    GLuint getNormalBufferId() const;

    /**
     * \brief Get the number of vertices.
     *
     * \return Number of vertices.
     */
    GLsizei getNumVertices() const;

private:

    /**
     * Number of vertices.
     */
    GLsizei mNumVertices;
    /**
     * Vertex buffer name.
     */
    GLuint mVertexBufferId;
    /**
     * TexCoord buffer name.
     */
    GLuint mTexCoordBufferId;
    /**
     * Normal buffer name.
     */
    GLuint mNormalBufferId;
};

}//namespace Ugly

#endif//__UGLYOBJMODEL_H__
